package per.dj.testpro.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import per.dj.testpro.entity.protocol.Message;
import per.dj.testpro.mapper.*;
import per.dj.testpro.netty.ServerHandler;
import per.dj.testpro.service.BaseService;
import per.dj.testpro.utils.redis.RedisUtil;

public class BaseServiceImpl implements BaseService {

    @Autowired
    protected ServerHandler serverHandler;

    @Autowired
    protected RedisUtil redisUtil;

        @Autowired
        protected UserInfoMapper userInfoMapper;


        @Autowired
        protected RechargeStationInfoMapper rechargeStationInfoMapper;

        @Autowired
        protected RechargePortInfoMapper rechargePortInfoMapper;

        @Autowired
        protected TransRecordInfoMapper transRecordInfoMapper;



        @Autowired
        protected SendMessageMapper sendMessageMapper;

        @Autowired
        protected ErrorInfoMapper errorInfoMapper;

    // 向发送数据s
    public boolean send(Message msg) {
        boolean res = serverHandler.send(msg.getHeader().getSimId(), msg.WriteToBytes());
        return res;
    }

}